package com.gxy.learn.design.model.create.factory.factory_method;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 工厂方法测试类
 * @author: gaoxueyong
 * @Date: 2022/11/6 22:13
 */
@Slf4j
public class CoffeeClient {
    private static final String AMERICA = "america";
    private static final String LATTE = "latte";
    public static void main(String[] args) {
        CoffeeStore coffeeStore  = new CoffeeStore();
        coffeeStore.setFactory(new AmericanCoffeeFactory());
        Coffee coffee = coffeeStore.orderCoffee();
        log.info("咖啡名称：{}",coffee.getName());
        coffee.addSugar();
        coffee.addMilk();
        coffeeStore.setFactory(new LatteCoffeeFactory());
        coffee = coffeeStore.orderCoffee();
        log.info("咖啡名称：{}",coffee.getName());
        coffee.addSugar();
        coffee.addMilk();

    }
}
